<?php 
	class Rectangle{

		public $width=0;
		public $height=0;
		//创建构造函数，当对象被创建时构造函数首先执行。
		function __construct($w,$h){

			$this->width=$w;
			$this->height=$h;


		}
		function setSize($w=0,$h=0){

			$this->width=$w;
			$this->height=$h;
		}
		function getArea(){

			return ($this->width*$this->height);
		}
		function getPerimeter(){

			return (($this->width+$this->height)*2);
		}
		function isSquare(){

			if($this->width==$this->height){
				return true;
			}else{
				return false;
			}

		}
	}
	$obj=new Rectangle(100,100);
	echo $obj->getArea();
	echo $obj->getPerimeter();
	if($obj->isSquare()){

		echo '正方形';
	}else{
		echo '长方形';
	}
 ?>